"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/**进度工具 */
const ora_1 = tslib_1.__importDefault(require("ora"));
/**进度菊花 */
class MSpinner {
    static ora = null;
    /**开始显示 */
    static start(text) {
        if (!MSpinner.ora)
            MSpinner.ora = (0, ora_1.default)();
        MSpinner.ora.start(text);
    }
    /**停止显示 */
    static stop() {
        if (!MSpinner.ora)
            return;
        MSpinner.ora.stop();
    }
    /**操作成功 */
    static success(text) {
        if (!MSpinner.ora)
            MSpinner.ora = (0, ora_1.default)();
        MSpinner.ora.succeed(text);
    }
    /**操作失败 */
    static fail(err) {
        if (!MSpinner.ora)
            MSpinner.ora = (0, ora_1.default)();
        MSpinner.stop();
        MSpinner.ora.fail(err);
    }
}
exports.default = MSpinner;
